package com.lwx.sys.utils;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
//会将该对象转成json格式

@Data
@NoArgsConstructor
public class TreeNode {

    private Integer id;

    @JsonProperty(value = "parentId")
    private Integer pid;

    private String title;

    private String href;

    private String icon;

    private Boolean spread;//节点是否展开着

    private String checkArr = "0";//默认设置不选中

    //children
    private List<TreeNode> children=new ArrayList<>();

    public TreeNode(Integer id, Integer pid, String title, String href, String icon, Boolean spread) {
        this.id = id;
        this.pid = pid;
        this.title = title;
        this.href = href;
        this.icon = icon;
        this.spread = spread;
    }

    public TreeNode(Integer id, Integer pid, String title, Boolean spread) {
        this.id = id;
        this.pid = pid;
        this.title = title;
        this.spread = spread;
    }

    public TreeNode(Integer id, Integer pid, String title, Boolean spread, String checkArr) {

        this.id = id;
        this.pid = pid;
        this.title = title;
        this.spread = spread;
        this.checkArr = checkArr;
    }
}
